home *** CD-ROM | disk | FTP | other *** search
/ Acorn Risc Technologies StrongARM CD-ROM / Acorn Risc Technologies StrongARM CD-ROM.iso / ftp / documents / appnotes / 001_015 / 009c / Text
Encoding:
Text File  |  1994-03-15  |  14.7 KB  |  404 lines

  1. -----------------------------------------------------------------------------
  2. 24th June 1992
  3. -----------------------------------------------------------------------------
  4. Support Group Application Note
  5. Number: 009
  6. Issue: 1
  7. Author:
  8. -----------------------------------------------------------------------------
  9.  
  10. ViewStore Hints and Tips
  11.  
  12. -----------------------------------------------------------------------------
  13. Applicable Hardware: BBC B
  14.                      BBC B+
  15.                      BBC Master 128
  16.                      BBC Master Compact
  17.  
  18. Related Application Notes: View Hints and Tips
  19.  
  20.  
  21. -----------------------------------------------------------------------------
  22. Copyright (C) Acorn Computers Limited 1992
  23.  
  24. Every effort has been made to ensure that the information in this leaflet is 
  25. true and correct at the time of printing. However, the products described in
  26. this leaflet are subject to continuous development and improvements and
  27. Acorn Computers Limited reserves the right to change its specifications at
  28. any time. Acorn Computers Limited cannot accept liability for any loss or
  29. damage arising from the use of any information or particulars in this
  30. leaflet. ACORN, ECONET and ARCHIMEDES are trademarks of Acorn Computers
  31. Limited.
  32. -----------------------------------------------------------------------------
  33. Support Group
  34. Acorn Computers Limited
  35. Acorn House
  36. Vision Park
  37. Histon
  38. Cambridge       CB4 4AE
  39. -----------------------------------------------------------------------------
  40. 1  DFS 0.90
  41.  
  42. Strange effects are sometimes encountered when using DFS 0.90 with
  43. Viewstore:
  44.  
  45. When using multiple surfaces the disc catalogue can be written to an
  46. incorrect surface.  This is manifested by the 'Disc changed' message on
  47. returning to command screen followed by drive 0 apparently being overwritten
  48. with the files from drive 2.
  49.  
  50. Some problems can occur when building indexes.
  51.  
  52. The solution is to upgrade to Acorn DFS 1.2, 1772 DFS or ADFS.  
  53.  
  54.  
  55. 2  LABEL  
  56.  
  57. To enable Utility Label to prompt for use of select file you need to prepare
  58. a patch file as follows:
  59.  
  60. Type:   *BASIC
  61.         ?&2800 = &FF
  62.         *save patch 2800 + 1
  63.  
  64. Then immediately before using utility Label enter:
  65.         *Load patch 50
  66.  
  67. Label with then give the 'Use Select file (N,Y)' prompt.
  68.  
  69.  
  70. 3  Entering records
  71.  
  72. On Viewstore 1.0 it is good practice when entering record to frequently
  73. force Viewstore to write the records to disc.  This can be done by pressing
  74. CTRL and DOWN ARROW.  This will write all of the new records safely to disc
  75. and reduce data corruption problems.
  76.  
  77.  
  78. 4  REPORT format file prefix
  79.  
  80. On Viewstore 1.0 different prefixes are required at different times when
  81. using report format files.  When editing report format files the format file
  82. is treated as a database and uses the Data prefix.  However, when using the
  83. report format file in the report utility it is treated as a format file and
  84. so uses the Format prefix.
  85.                              
  86.  
  87. 5  Running out of room in REPORT
  88.  
  89. Report format files can grow very large which can cause memory problems when
  90. using them in utility report.  Their size can be significantly reduced by
  91. running them through utility Convert after editing them.  In convert reply
  92. as follows:
  93.  
  94.         Use select file (N,Y)?  N
  95.         Field 1?  * RETURN
  96.         Field 2?  RETURN
  97.         Record size?  +20
  98.         New filename:  r.newfilename
  99.  
  100.  
  101. 6  Minimal space after setup
  102.  
  103. In Viewstore 1.0 it is occasionally possible for the Space field at the top
  104. of the database display to be a small number eg 11 rather than the several
  105. thousand bytes which it should be.  This can be rectified by making an entry
  106. eg +30 in the record size field in the database header.
  107.  
  108.  
  109. 7  Indexes on entering data
  110.  
  111. Remember to index by entry when entering new data.  This gives faster
  112. response tines and reduces the likelihood of index corruption on an
  113. unexpected error like disc fault.
  114.  
  115.  
  116. 8  Database drive
  117.  
  118. Remember not to leave any files after the data file on the data drive.  This
  119. reduces Can't extend problems on DFS.
  120.  
  121.  
  122. 9  F.REPORT
  123.  
  124. Remember to copy the special format file F.REPORT from the utilities onto
  125. your format file disc before editing report format files.
  126.  
  127.  
  128. 10  Selecting on blank fields
  129.  
  130. When using Select you can match a blank field by giving the criterion field
  131. =""
  132.  
  133.  
  134. 11  Importing corrupt databases
  135.  
  136. If a database is corrupted for any reason, for example if you lose the end
  137. marker or get 'Bad File' you can generally recover all or almost all of your
  138. data by importing the database into another file.  This is often much
  139. quicker than retyping although you can, of course, refer to your backup.
  140.  
  141.  
  142. 12  When using ADFS with Viewstore
  143.  
  144. The error COMPACTION REQUIRED ON CHANNEL 57 can be encountered.
  145.  
  146. ADFS, if extending a file must keep the file contiguous.  For example, if
  147. there is no space after the file, it copies the file into an area where
  148. there is more space.  The free space on the disc must be larger than the
  149. file being expanded.
  150.  
  151. SOLUTION
  152.  
  153. Copy the large file onto a blank disc.  Delete the file from the main disc. 
  154. Compact the disc.  Copy the file back.  It should now expand OK - BUT in an
  155. application such as this it is very sensible if largest files kept on a disc
  156. on their own. 
  157.  
  158.  
  159. 13  SELECT syntax
  160.  
  161. Remember to use brackets and delimiters in select criteria.  For example:
  162.  
  163.         rrp/VAT=number and £=10000
  164.  
  165. is unlikely to have the desired effect.  You should enter:
  166.  
  167.         ("rrp/VAT"=number) and ("£"=10000)
  168.  
  169. to be completely ambiguous.
  170.  
  171.  
  172. 14  Sort memory
  173.  
  174. Before running utility select to sort a file on the Model B remember to
  175. enter mode 6 or mode 7 to give the greatest available memory for the sort.
  176.  
  177.  
  178. 15  Highlighting part lines in REPORT headers
  179.  
  180. To highlight part of a line in a report header do the following.  Type the
  181. header line into the report and insert a single @ character at each point
  182. you want the highlighting to vary.  Then in the field list enter a comment
  183. specifier for each @ and succeed the comment specifier with the highlight
  184. codes.  For example:
  185.  
  186.         Type            Half1                   Field list
  187.         H               Ordinary@Bold@Ordinary  333,@1,333,@1
  188.         C               Press RETURN    
  189.  
  190. When Viewstore reaches the first @ it sends the first three highlight 3s to
  191. the printer driver which will switch on emboldening.  It then replaces the
  192. first @ by comment 1.  The user is prompted to press RETURN for the first
  193. comment which will fill the comment with spaces (one in this case).  The
  194. word underlined will then be printed in bold before the emboldening is
  195. switched off and another blank comment is printed.
  196.  
  197.  
  198. 16  Editing REPORT format files
  199.  
  200. Report format files can be edited in the View word processor.  Read the
  201. report format file into View and insert a ruler at the top of the file which
  202. has no right margin and tab stops set wide enough to align the field in
  203. columns.  Now edit the file.  Be careful to keep the fields separated by the
  204. correct number of tabs and make sure that the lines do not exceed 132
  205. characters.  Before saving the file delete the ruler at the top.  Finally
  206. import the file back as a database, field separator being 9 and record
  207. separator being 13.
  208.  
  209.  
  210. 17  Final REPORT editing
  211.  
  212. Reports can be edited by spooling the report to disc, reading into the View
  213. word processor, editing and printing from View.
  214.  
  215.  
  216. 18  Case sensitivity in Watford DFS
  217.  
  218. Some versions of Watford DFS do not allow a mixture of cases in
  219. directory names.  It is necessary to ensure all filenames specifications are
  220. in the correct case.  In particular utilities should be renamed from
  221. directory "u" to "U".
  222.  
  223. 19  Filesizes and Utilities
  224.  
  225. The Viewstore utilities all assume maximum filesizes of 65536 when
  226. performing calculations on filesizes.  In particular giving a size n of more
  227. than 65536 bytes to reserve in the setup utility caused Viewstore to reserve
  228. n modulo 65536 bytes.  So specifying 70000 bytes will actually reserve 4464
  229. bytes.  This does not limit either the size of your database file or the
  230. sizes of your index files.
  231.  
  232.  
  233. 20  Bytes to reserve - Load time tradeoff
  234.  
  235. On loading a database Viewstore quickly loads the format file, opens up the
  236. data file and reads it from the end of the file backwards to the end of the
  237. data marker.  If there is a lot of space at the end of the file this may
  238. take a little time.  Consequently unless you need space reserved at the end
  239. of the data file (if you are using a single DFS surface) it is best to
  240. reserve 0 bytes when setting up the database.
  241.  
  242.  
  243. 21  Writing utilities
  244.  
  245. It is possible to write extra utilities for use with Viewstore. 
  246. However, this should only be attempted by experienced 6502 programmers who
  247. either require a utility for special use or who are planning to exploit the
  248. utilities commercially.  Acorn have no copyright restrictions on others
  249. selling their own Viewstore utilities.
  250.  
  251.  
  252. 22  Copyright
  253.  
  254. All of the code and documentation supplied with Viewstore is subject to
  255. English copyright law.  You are not allowed to copy the Viewstore  EPROM
  256. without explicit permission from Acorn.  You may copy the Viewstore utility
  257. disc for your own use.
  258.  
  259.  
  260. 23  This is a BASIC utility that enables you to append one database to
  261. another in Viewstore
  262.  
  263. The simple format of Viewstore database files enables simple manipulation by
  264. programs written in BBC BASIC.   For example, the following  program appends
  265. one database file to another.
  266.  
  267. NOTE:  the field order within records of both databases should be the same
  268. for sensible results.
  269.  
  270.         10   INPUT "File 1",file1$
  271.         20   INPUT "File 2",file2$
  272.         30   one=OPENUP(file1$) :REM BASIC 1 users should use OPENIN
  273.         40   two=OPENIN(file2$)
  274.         50   REPEAT UNTIL BGET#one=1
  275.         60   PTR#1=PTR#One-1
  276.         70   REPEAT
  277.         80   byte=BGET#two
  278.         90   BPUT#one,byte
  279.         100  UNTIL byte=1
  280.         110  CLOSE#one
  281.         120  CLOSE#2
  282.  
  283.  
  284. 24  Obtaining Reports from a database (This is an example)
  285.  
  286. Whether or not you have prepared a Select File when running the SELECT
  287. utility, you can produce a simple report on screen of the first 80
  288. characters of each record, or if you choose the printer option, you can
  289. specify the width of the paper, page length and whether or not single sheets
  290. are required.  The simple report will give all the records or a selection,
  291. depending on whether a Select File is used.  If you follow the Report
  292. Utility routine through without using a Report Format File (answer N to the
  293. prompt "User report format file N,Y?") you will see that this 'simple'
  294. report is not particularly suited to the chosen layout of your data in th
  295. name and address file.  The key factor here is that the records are shown in
  296. the spreadsheet format, and are thus limited to the width of the screen
  297. (usually a max of 80 characters), or the specified paper width if you choose
  298. the printer option, so once again you are not going to see all the data from
  299. the database,  there are some sorts of database for which this type of
  300. report is perfect (such as accounting applications) where you might use a
  301. spreadsheet style display for the database and limit the width to 80
  302. characters anyway, in which case this form of reporting is perfectly
  303. satisfactory.
  304.  
  305. The above is suggested as a guideline and we hope that this will enable you
  306. to setup a report specifically for your printing requirements.
  307.  
  308.  
  309. 25 Printing labels from a Viewstore database using label utility
  310.  
  311. The Label Utility enables you to extract information from a database for
  312. printing labels.  First load the database from which you want to print the
  313. labels and ensure that the computer has been prepared for printing.  You
  314. will notice on the screen after loading the database:
  315.  
  316.         Editing D.(database filename)
  317.         Format F.(format filename)
  318.  
  319. Then type:      UTILITY LABEL (press return)
  320.  
  321. The Utility Label program will ask you various questions that you should
  322. answer as below:
  323.  
  324.         Use select file (N,Y)?  (type N if this applies to the whole
  325. database or Y is to select file)
  326.         Screen or Printer (S,P)?  P (RETURN)
  327.         Label height (lines)?  6
  328.         Lines between each label?  3
  329.         Width of label?  25
  330.         Characters between each label?  6
  331.         Number of labels across the page?  3
  332.         Line 1?  )
  333.         Line 2?  )  enter the field name or names from which information
  334.         Line 3?  )  has to be extracted.  Where there is more than one field
  335.         Line 4?  )  name required this must be separated by commas
  336.         Line 5?  )  eg  Name, Address
  337.         Line 6?  )
  338.         (press RETURN)
  339.  
  340.  
  341. 26  Using Viewstore convert
  342.  
  343. 1.  'Convert' converts an existing database, or a SELECTED subset into a new
  344. file.  To add a space to an existing file use:
  345.  
  346.         Use Select file (N,Y)?  N
  347.         Field 1? *
  348.         :
  349.         Filename?  (a new name)
  350.         Record size: +100
  351.  
  352. Then use LOAD (new name) (old name) to use the new database, with the old
  353. format file, or rename the (new name) to (old name)  (backing up the old file
  354. first!).
  355.  
  356. 2  Printing out some fields or a file is done with the REPORT Utility - see
  357. the manual for details.
  358.  
  359. 3  Furthermore, if you want to pass an alphabetically sorted database to
  360. View it is done by SELECTing the fields you want, sorting on the appropriate
  361. field, then using CONVERT, this time with a select file, to produce a new
  362. database in sorted order, which can be passed to View.
  363.  
  364.  
  365. 27  This applies to View and Viewstore (PDG)
  366.  
  367. Although View has only two highlight codes these can be redefined using HT
  368. code in "Edit command" (Shift F8) to make use of other features available on
  369. the printer.  The actual values associated with the highlight codes can vary
  370. from 128 to 148.
  371.  
  372. If you want to access extended characters you use HT 2 130.  This is entered
  373. in your View document using Shift F8 (Edit command).  However, you should
  374. enter the appropriate codes in response to the printer initialisation
  375. question in the PDG.
  376.  
  377. For example:  In View  to change font you would enter *-- (means Highlight
  378. 2,1,1).  View then sends to the Printer Driver 130 128 128 codes to switch
  379. to the new font.
  380.  
  381. With Viewstore you would need to put these codes in REPORT FORMAT file 3 1
  382. 1.  Viewstore sends to the Printer Driver 127 + number (130 128 128).
  383.  
  384.  
  385. 28  Viewstore import procedure - Viewstore to Viewstore
  386.  
  387. CHAIN "IMPORT"
  388.  
  389.         Question                            Input
  390.  
  391.         Source file                         D.(filename)
  392.         Destination file                    :(drive number).D.(new filename)
  393.         Position in file where data starts  0>RETURN<
  394.         Record Separator                    13 (carriage return in Viewstore)
  395.         Appears before first record         N
  396.         Appears before last record          Y
  397.         Field Separator                     9 (tab character in Viewstore)
  398.         Before first character              N
  399.         After last character                N
  400.         End of file marker                  0
  401.         Is data reserved                    N (it is in database)
  402.         Trailing character to skip          N
  403.         Record size                         <RETURN>
  404.